Skip to main content
This forum is closed to new posts and responses. Individual names altered for privacy purposes. The information contained in this website is provided for informational purposes only and should not be construed as a forum for customer support requests. Any customer support requests should be directed to the official HCL customer support channels below:

HCL Software Customer Support Portal for U.S. Federal Government clients
HCL Software Customer Support Portal

HCL Notes/Domino 8.5 Forum (includes Notes Traveler)

HCL Notes/Domino 8.5 Forum (includes Notes Traveler)

Previous Next

Well I solved your code issue.

Ok the issue is not related to MKDIR. Appears to be related to DIR$.

I had some spare time, so here is what I did.

1. Cleaned up your code to a much smaller sample.

2. Ran it and deleted the directories from the command prompt. Worked fine.

3. Ran it twice, as the logic is different the second time. Attempting to delete the directories the second last in the tree could not be removed (eg. "c:\a\b\c\d" directory c could not be removed).

4. Tested it a few times on different directory structures and confirmed it is related to the second last directory.

5. Moved the DIR$ out of the IF conditional statements to determine if they are connected. Could still reproduce the issue.

6. Now that I know the issue is related to DIR$ I checked for existing SPRs. I found JDYU6679FJ. this is a crash issue (which turned out not to be an issue). Not directly related to this issue, but mentioned that if DIR$ is called with parameters the CAPI code is put into a loop holding the directory. It is only returned if an error condition happens.

7. To test this I added a line at the end of the code to do DIR$("C:\temp"). As it has no parameters it should break the loop. Testing with this I was no longer able to recreate the issue.

Created SPR SODY85SM84 which details this issue so development can investigate further. I will do up a tech note later on it.

Here is the sample code if your interested. Hope all this helps.

--------
Option Public
Option Declare

Const ATTR_DIRECTORY = 16

Sub Initialize()
Const testDirectory = "c:\temp\simon\11\22\33\" ' requires \ at the end of the string or will fail.
createDirs(testDirectory)
End Sub

Private Function createDirs(path As String) As Boolean

On Error GoTo CP_DOH
Dim drive As String
Dim orgDir As String
Dim part As String
Dim rest As String
Dim ndx As Long
Dim first As Boolean
Dim dirCheck As string

part=""
drive=""
createDirs=True
first=True
orgDir=CurDir$
rest=path
ndx=InStr(rest, "\")

Print |Creating dirs for '|+path+|"|

While(ndx>0)
If(part="") Then
part=Left$(rest, ndx-1)
Else
part=part+"\"+Left$(rest, ndx-1)
End If

rest=Mid$(rest, ndx+1)

If(first And InStr(part, ":")>0) Then
Print |- Set drive |+part

drive=CurDrive$
ChDrive part
first=False
Else
dirCheck = Dir$(part, ATTR_DIRECTORY)
Print "Dir$ = " + dirCheck

If(dirCheck = "" ) Then
Print |- Mkdir |+part
MkDir(part)
Else
Print |- Reuse |+part
End If
End If

ndx=InStr(rest, "\")
Wend

' This line will stop the locking from occurring.
' Appears to be related to SPR JDYU6679FJ
' ***********************************************
' dirCheck = Dir$("c:\temp") ' Force without parameters

CP_DONE:
If(drive<>"") Then
ChDrive drive
End If

' return to original directory.
ChDir orgDir

Exit Function

CP_DOH:
createDirs=False
print | line | & Erl & | of createDirs: "|+Error$+|"|

Resume CP_DONE
End Function


Feedback response number WEBB85SMUW created by ~Rex Pretoolitoden on 05/25/2010

MKDIR command locks subdir !? (~Evelyn Lopvelu... 20.May.10)
. . This has always been the case... (~James Brewever... 20.May.10)
. . MKDIR does not lock the directory. (~Rex Pretoolito... 20.May.10)
. . . . I've seen this on servers too. (~Sanjay Quettum... 20.May.10)
. . . . . . I had also tried. (~Rex Pretoolito... 20.May.10)
. . . . MKDIR command locks somtines the su... (~Evelyn Lopvelu... 24.May.10)
. . . . . . Now a kill path$+"*.*" does not wor... (~Evelyn Lopvelu... 27.May.10)
. . . . . . . . Workaround for KILL command in LS (~Evelyn Lopvelu... 27.May.10)
. . . . I beg to differ... (~James Brewever... 24.May.10)
. . . . . . Any chance narrowing it down? (~Rex Pretoolito... 24.May.10)
. . . . . . . . No. (~James Brewever... 25.May.10)
. . . . . . . . . . Well I solved your code issue. (~Rex Pretoolito... 25.May.10)
. . . . . . . . . . . . Again I wish BP had access to the S... (~James Brewever... 25.May.10)
. . . . . . . . . . . . . . Ditto - access to the SPR db would ... (~Sanjay Quettum... 25.May.10)




Printer-friendly

Search this forum

Member Tools


RSS Feeds

 RSS feedsRSS
All forum posts RSS
All main topics RSS